<template>
  <view class="search-container" :style="{'background-color': bgc}" @click="searchHandle">
    <view class="search-input" :style="{'border-radius': radius + 'px'}">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="search-placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name: "my-search",
    data() {
      return {

      };
    },
    
    props: {
      bgc: {
        type: String,
        default: '#c00000'
      },
      radius: {
        type: Number,
        default: 18 // 单位 px
      }
    },
    
    methods: {
      searchHandle () {
        this.$emit('searchHandle')
      }
    }
  }
</script>

<style lang="scss">
  .search-container {
    height: 50px;
    // background-color: #c00000;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;

    .search-input {
      width: 100%;
      height: 36px;
      text-align: center;
      line-height: 36px;
      // border-radius: 18px;
      background-color: #ffffff;

      .search-placeholder {
        font-size: 15px;
        margin-left: 5px;
      }
    }


  }
</style>
